'''
Created on Dec 27, 2010

@author: kivson
'''

def main():
    import sys
    for hora in sys.stdin:
        print converteHoraNormalDecimal(hora[:-1])
    pass

def converteHoraNormalDecimal(hora):
    totalSistemaNormal = 24*60*60*100.0
    totalSistemaDecimal= 10*100*100*100.0
    fatorTranformacao = totalSistemaDecimal/totalSistemaNormal
    
    ms = int(hora[-2:])
    sec= int(hora[-4:-2])
    min= int(hora[-6:-4])
    hrs= int(hora[-8:-6])
    totalNormal = hrs*60*60*100 + min*60*100 + sec*100 + ms
    
    totalDecimal= totalNormal*fatorTranformacao
    
    msd = int(totalDecimal % 100)
    totalDecimal /= 100
    secd= int(totalDecimal % 100)
    totalDecimal /= 100
    mind= int(totalDecimal % 100)
    totalDecimal /= 100
    hrsd= int(totalDecimal)
    
    horadecimal = str(hrsd) + str(mind).zfill(2) + str(secd).zfill(2) + str(msd).zfill(2)
    
    return horadecimal
    
    
if __name__ == '__main__':
    main()